//************************************************************************
/// <copyrigth>2024-2025 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// Cross-Platform event for multithreads
///</describe>
/// <date>2024/4/14</date>
///***********************************************************************
#ifndef BEVENT_H
#define BEVENT_H

#include "ModuleLoader/ModuleConfig.h"

namespace SystemTool
{
    class CLASS_ITEM BEvent
    {
    public:
        // Construct the obj
        BEvent();

        // Destruct the obj
        ~BEvent();

    private:
        // Copy construct
        BEvent(const BEvent& other) = delete;

        // Assignment
        BEvent& operator=(const BEvent& other) = delete;

    public:
        // Set the event to signal
        void Signal();

        // Set the event to unsignal
        void UnSignal();

        // Wait for the event to be signal
        void Wait(long lMs = 0);

    private:
        // Poco event
        void* m_pEvent;
    };
}

#endif // BEVENT_H
